import { connect } from 'dva';
import withRouter from 'umi/withRouter';
import styles from './app.less';
import {Layout} from '../components';
import {LocaleProvider,BackTop,message } from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
const {Loading} = Layout;
// 全局消息提示配置
message.config({
    top: 'calc(50% - 20px)',
    duration: 3,
    maxCount: 3,
  });
function BasicLayout(props) {
  const {loading}=props
  const isLoading=loading.global;
  return (
    <LocaleProvider locale={zhCN}>
      <div className={styles.normal}>
        <Loading tag={isLoading}/>
        { props.children }
      </div>
    </LocaleProvider>

  );
}

export default withRouter(connect((loading)=>(loading))(BasicLayout));
